home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 1.iso / dist / fw_apache2.idb / usr / freeware / apache2 / include / http_core.h.z / http_core.h
C/C++ Source or Header  |  2002-07-08  |  21KB  |  619 lines

  1. /* ====================================================================
  2.  * The Apache Software License, Version 1.1
  3.  *
  4.  * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
  5.  * reserved.
  6.  *
  7.  * Redistribution and use in source and binary forms, with or without
  8.  * modification, are permitted provided that the following conditions
  9.  * are met:
  10.  *
  11.  * 1. Redistributions of source code must retain the above copyright
  12.  *    notice, this list of conditions and the following disclaimer.
  13.  *
  14.  * 2. Redistributions in binary form must reproduce the above copyright
  15.  *    notice, this list of conditions and the following disclaimer in
  16.  *    the documentation and/or other materials provided with the
  17.  *    distribution.
  18.  *
  19.  * 3. The end-user documentation included with the redistribution,
  20.  *    if any, must include the following acknowledgment:
  21.  *       "This product includes software developed by the
  22.  *        Apache Software Foundation (http://www.apache.org/)."
  23.  *    Alternately, this acknowledgment may appear in the software itself,
  24.  *    if and wherever such third-party acknowledgments normally appear.
  25.  *
  26.  * 4. The names "Apache" and "Apache Software Foundation" must
  27.  *    not be used to endorse or promote products derived from this
  28.  *    software without prior written permission. For written
  29.  *    permission, please contact apache@apache.org.
  30.  *
  31.  * 5. Products derived from this software may not be called "Apache",
  32.  *    nor may "Apache" appear in their name, without prior written
  33.  *    permission of the Apache Software Foundation.
  34.  *
  35.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  36.  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  37.  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  38.  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  39.  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  40.  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  41.  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  42.  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  43.  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  44.  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  45.  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  46.  * SUCH DAMAGE.
  47.  * ====================================================================
  48.  *
  49.  * This software consists of voluntary contributions made by many
  50.  * individuals on behalf of the Apache Software Foundation.  For more
  51.  * information on the Apache Software Foundation, please see
  52.  * <http://www.apache.org/>.
  53.  *
  54.  * Portions of this software are based upon public domain software
  55.  * originally written at the National Center for Supercomputing Applications,
  56.  * University of Illinois, Urbana-Champaign.
  57.  */
  58.  
  59. #ifndef APACHE_HTTP_CORE_H
  60. #define APACHE_HTTP_CORE_H
  61.  
  62. #include "apr.h"
  63. #include "apr_hash.h"
  64. #include "util_filter.h"
  65.  
  66. #if APR_HAVE_STRUCT_RLIMIT
  67. #include <sys/time.h>
  68. #include <sys/resource.h>
  69. #endif
  70.  
  71.  
  72. #ifdef __cplusplus
  73. extern "C" {
  74. #endif
  75.  
  76. /**
  77.  * @package CORE HTTP Daemon
  78.  */
  79.  
  80. /* ****************************************************************
  81.  *
  82.  * The most basic server code is encapsulated in a single module
  83.  * known as the core, which is just *barely* functional enough to
  84.  * serve documents, though not terribly well.
  85.  *
  86.  * Largely for NCSA back-compatibility reasons, the core needs to
  87.  * make pieces of its config structures available to other modules.
  88.  * The accessors are declared here, along with the interpretation
  89.  * of one of them (allow_options).
  90.  */
  91.  
  92. #define OPT_NONE 0
  93. #define OPT_INDEXES 1
  94. #define OPT_INCLUDES 2
  95. #define OPT_SYM_LINKS 4
  96. #define OPT_EXECCGI 8
  97. #define OPT_UNSET 16
  98. #define OPT_INCNOEXEC 32
  99. #define OPT_SYM_OWNER 64
  100. #define OPT_MULTI 128
  101. #define OPT_ALL (OPT_INDEXES|OPT_INCLUDES|OPT_SYM_LINKS|OPT_EXECCGI)
  102.  
  103. /* options for get_remote_host() */
  104. /* REMOTE_HOST returns the hostname, or NULL if the hostname
  105.  * lookup fails.  It will force a DNS lookup according to the
  106.  * HostnameLookups setting.
  107.  */
  108. #define REMOTE_HOST (0)
  109.  
  110. /* REMOTE_NAME returns the hostname, or the dotted quad if the
  111.  * hostname lookup fails.  It will force a DNS lookup according
  112.  * to the HostnameLookups setting.
  113.  */
  114. #define REMOTE_NAME (1)
  115.  
  116. /* REMOTE_NOLOOKUP is like REMOTE_NAME except that a DNS lookup is
  117.  * never forced.
  118.  */
  119. #define REMOTE_NOLOOKUP (2)
  120.  
  121. /* REMOTE_DOUBLE_REV will always force a DNS lookup, and also force
  122.  * a double reverse lookup, regardless of the HostnameLookups
  123.  * setting.  The result is the (double reverse checked) hostname,
  124.  * or NULL if any of the lookups fail.
  125.  */
  126. #define REMOTE_DOUBLE_REV (3)
  127.  
  128. #define SATISFY_ALL 0
  129. #define SATISFY_ANY 1
  130. #define SATISFY_NOSPEC 2
  131.  
  132. /* Make sure we don't write less than 8000 bytes at any one time.
  133.  */
  134. #define AP_MIN_BYTES_TO_WRITE  8000
  135.  
  136. /**
  137.  * Retrieve the value of Options for this request
  138.  * @param r The current request
  139.  * @return the Options bitmask
  140.  * @deffunc int ap_allow_options(request_rec *r)
  141.  */
  142. AP_DECLARE(int) ap_allow_options(request_rec *r);
  143.  
  144. /**
  145.  * Retrieve the value of the AllowOverride for this request
  146.  * @param r The current request
  147.  * @return the overrides bitmask
  148.  * @deffunc int ap_allow_overrides(request_rec *r)
  149.  */
  150. AP_DECLARE(int) ap_allow_overrides(request_rec *r);
  151.  
  152. /**
  153.  * Retrieve the value of the DefaultType directive, or text/plain if not set
  154.  * @param r The current request
  155.  * @return The default type
  156.  * @deffunc const char *ap_default_type(request_rec *r)
  157.  */
  158. AP_DECLARE(const char *) ap_default_type(request_rec *r);     
  159.  
  160. /**
  161.  * Retrieve the document root for this server
  162.  * @param r The current request
  163.  * @warning Don't use this!  If your request went through a Userdir, or 
  164.  * something like that, it'll screw you.  But it's back-compatible...
  165.  * @return The document root
  166.  * @deffunc const char *ap_document_root(request_rec *r)
  167.  */
  168. AP_DECLARE(const char *) ap_document_root(request_rec *r);
  169.  
  170. /**
  171.  * Lookup the remote client's DNS name or IP address
  172.  * @param conn The current connection
  173.  * @param dir_config The directory config vector from the request
  174.  * @param type The type of lookup to perform.  One of:
  175.  * <pre>
  176.  *     REMOTE_HOST returns the hostname, or NULL if the hostname
  177.  *                 lookup fails.  It will force a DNS lookup according to the
  178.  *                 HostnameLookups setting.
  179.  *     REMOTE_NAME returns the hostname, or the dotted quad if the
  180.  *                 hostname lookup fails.  It will force a DNS lookup according
  181.  *                 to the HostnameLookups setting.
  182.  *     REMOTE_NOLOOKUP is like REMOTE_NAME except that a DNS lookup is
  183.  *                     never forced.
  184.  *     REMOTE_DOUBLE_REV will always force a DNS lookup, and also force
  185.  *                   a double reverse lookup, regardless of the HostnameLookups
  186.  *                   setting.  The result is the (double reverse checked) 
  187.  *                   hostname, or NULL if any of the lookups fail.
  188.  * </pre>
  189.  * @param str_is_ip unless NULL is passed, this will be set to non-zero on output when an IP address 
  190.  *        string is returned
  191.  * @return The remote hostname
  192.  * @deffunc const char *ap_get_remote_host(conn_rec *conn, void *dir_config, int type, int *str_is_ip)
  193.  */
  194. AP_DECLARE(const char *) ap_get_remote_host(conn_rec *conn, void *dir_config, int type, int *str_is_ip);
  195.  
  196. /**
  197.  * Retrieve the login name of the remote user.  Undef if it could not be
  198.  * determined
  199.  * @param r The current request
  200.  * @return The user logged in to the client machine
  201.  * @deffunc const char *ap_get_remote_logname(request_rec *r)
  202.  */
  203. AP_DECLARE(const char *) ap_get_remote_logname(request_rec *r);
  204.  
  205. /* Used for constructing self-referencing URLs, and things like SERVER_PORT,
  206.  * and SERVER_NAME.
  207.  */
  208. /**
  209.  * build a fully qualified URL from the uri and information in the request rec
  210.  * @param p The pool to allocate the URL from
  211.  * @param uri The path to the requested file
  212.  * @param r The current request
  213.  * @return A fully qualified URL
  214.  * @deffunc char *ap_construct_url(apr_pool_t *p, const char *uri, request_rec *r)
  215.  */
  216. AP_DECLARE(char *) ap_construct_url(apr_pool_t *p, const char *uri, request_rec *r);
  217.  
  218. /**
  219.  * Get the current server name from the request
  220.  * @param r The current request
  221.  * @return the server name
  222.  * @deffunc const char *ap_get_server_name(request_rec *r)
  223.  */
  224. AP_DECLARE(const char *) ap_get_server_name(request_rec *r);
  225.  
  226. /**
  227.  * Get the current server port
  228.  * @param The current request
  229.  * @return The server's port
  230.  * @deffunc apr_port_t ap_get_server_port(const request_rec *r)
  231.  */
  232. AP_DECLARE(apr_port_t) ap_get_server_port(const request_rec *r);
  233.  
  234. /**
  235.  * Return the limit on bytes in request msg body 
  236.  * @param r The current request
  237.  * @return the maximum number of bytes in the request msg body
  238.  * @deffunc apr_off_t ap_get_limit_req_body(const request_rec *r)
  239.  */
  240. AP_DECLARE(apr_off_t) ap_get_limit_req_body(const request_rec *r);
  241.  
  242. /**
  243.  * Return the limit on bytes in XML request msg body
  244.  * @param r The current request
  245.  * @return the maximum number of bytes in XML request msg body
  246.  * @deffunc size_t ap_get_limit_xml_body(const request_rec *r)
  247.  */
  248. AP_DECLARE(size_t) ap_get_limit_xml_body(const request_rec *r);
  249.  
  250. /**
  251.  * Install a custom response handler for a given status
  252.  * @param r The current request
  253.  * @param status The status for which the custom response should be used
  254.  * @param string The custom response.  This can be a static string, a file
  255.  *               or a URL
  256.  */
  257. AP_DECLARE(void) ap_custom_response(request_rec *r, int status, const char *string);
  258.  
  259. /**
  260.  * Check for a definition from the server command line
  261.  * @param name The define to check for
  262.  * @return 1 if defined, 0 otherwise
  263.  * @deffunc int ap_exists_config_define(const char *name)
  264.  */
  265. AP_DECLARE(int) ap_exists_config_define(const char *name);
  266. /* FIXME! See STATUS about how */
  267. AP_DECLARE_NONSTD(int) ap_core_translate(request_rec *r);
  268.  
  269. /* Authentication stuff.  This is one of the places where compatibility
  270.  * with the old config files *really* hurts; they don't discriminate at
  271.  * all between different authentication schemes, meaning that we need
  272.  * to maintain common state for all of them in the core, and make it
  273.  * available to the other modules through interfaces.
  274.  */
  275. typedef struct require_line require_line;
  276.  
  277. /** A structure to keep track of authorization requirements */
  278. struct require_line {
  279.     /** Where the require line is in the config file. */
  280.     apr_int64_t method_mask;
  281.     /** The complete string from the command line */
  282.     char *requirement;
  283. };
  284.      
  285. /**
  286.  * Return the type of authorization required for this request
  287.  * @param r The current request
  288.  * @return The authorization required
  289.  * @deffunc const char *ap_auth_type(request_rec *r)
  290.  */
  291. AP_DECLARE(const char *) ap_auth_type(request_rec *r);
  292.  
  293. /**
  294.  * Return the current Authorization realm
  295.  * @param r The current request
  296.  * @return The current authorization realm
  297.  * @deffunc const char *ap_auth_name(request_rec *r)
  298.  */
  299. AP_DECLARE(const char *) ap_auth_name(request_rec *r);     
  300.  
  301. /**
  302.  * How the requires lines must be met.
  303.  * @param r The current request
  304.  * @return How the requirements must be met.  One of:
  305.  * <pre>
  306.  *      SATISFY_ANY    -- any of the requirements must be met.
  307.  *      SATISFY_ALL    -- all of the requirements must be met.
  308.  *      SATISFY_NOSPEC -- There are no applicable satisfy lines
  309.  * </pre>
  310.  * @deffunc int ap_satisfies(request_rec *r)
  311.  */
  312. AP_DECLARE(int) ap_satisfies(request_rec *r);
  313.  
  314. /**
  315.  * Retrieve information about all of the requires directives for this request
  316.  * @param r The current request
  317.  * @return An array of all requires directives for this request
  318.  * @deffunc const apr_array_header_t *ap_requires(request_rec *r)
  319.  */
  320. AP_DECLARE(const apr_array_header_t *) ap_requires(request_rec *r);    
  321.  
  322. #ifdef CORE_PRIVATE
  323.  
  324. /*
  325.  * Core is also unlike other modules in being implemented in more than
  326.  * one file... so, data structures are declared here, even though most of
  327.  * the code that cares really is in http_core.c.  Also, another accessor.
  328.  */
  329.  
  330. AP_DECLARE_DATA extern module core_module;
  331.  
  332. /* Per-request configuration */
  333.  
  334. typedef struct {
  335.     /* bucket brigade used by getline for look-ahead and 
  336.      * ap_get_client_block for holding left-over request body */
  337.     struct apr_bucket_brigade *bb;
  338.  
  339.     /* an array of per-request working data elements, accessed
  340.      * by ID using ap_get_request_note()
  341.      * (Use ap_register_request_note() during initialization
  342.      * to add elements)
  343.      */
  344.     void **notes;
  345. } core_request_config;
  346.  
  347. /* Standard entries that are guaranteed to be accessible via
  348.  * ap_get_request_note() for each request (additional entries
  349.  * can be added with ap_register_request_note())
  350.  */
  351. #define AP_NOTE_DIRECTORY_WALK 0
  352. #define AP_NOTE_LOCATION_WALK  1
  353. #define AP_NOTE_FILE_WALK      2
  354. #define AP_NUM_STD_NOTES       3
  355.  
  356. /**
  357.  * Reserve an element in the core_request_config->notes array
  358.  * for some application-specific data
  359.  * @return An integer key that can be passed to ap_get_request_note()
  360.  *         during request processing to access this element for the
  361.  *         current request.
  362.  */
  363. AP_DECLARE(apr_size_t) ap_register_request_note(void);
  364.  
  365. /**
  366.  * Retrieve a pointer to an element in the core_request_config->notes array
  367.  * @param r The request
  368.  * @param note_num  A key for the element: either a value obtained from
  369.  *        ap_register_request_note() or one of the predefined AP_NOTE_*
  370.  *        values.
  371.  * @return NULL if the note_num is invalid, otherwise a pointer to the
  372.  *         requested note element.
  373.  * @remark At the start of a request, each note element is NULL.  The
  374.  *         handle provided by ap_get_request_note() is a pointer-to-pointer
  375.  *         so that the caller can point the element to some app-specific
  376.  *         data structure.  The caller should guarantee that any such
  377.  *         structure will last as long as the request itself.
  378.  */
  379. AP_DECLARE(void **) ap_get_request_note(request_rec *r, apr_size_t note_num);
  380.  
  381. /* Per-directory configuration */
  382.  
  383. typedef unsigned char allow_options_t;
  384. typedef unsigned char overrides_t;
  385.  
  386. /*
  387.  * Bits of info that go into making an ETag for a file
  388.  * document.  Why a long?  Because char historically
  389.  * proved too short for Options, and int can be different
  390.  * sizes on different platforms.
  391.  */
  392. typedef unsigned long etag_components_t;
  393.  
  394. #define ETAG_UNSET 0
  395. #define ETAG_NONE  (1 << 0)
  396. #define ETAG_MTIME (1 << 1)
  397. #define ETAG_INODE (1 << 2)
  398. #define ETAG_SIZE  (1 << 3)
  399. #define ETAG_BACKWARD (ETAG_MTIME | ETAG_INODE | ETAG_SIZE)
  400. #define ETAG_ALL   (ETAG_MTIME | ETAG_INODE | ETAG_SIZE)
  401.  
  402. typedef enum {
  403.     srv_sig_unset,
  404.     srv_sig_off,
  405.     srv_sig_on,
  406.     srv_sig_withmail
  407. } server_signature_e;
  408.  
  409. typedef struct {
  410.     /* path of the directory/regex/etc. see also d_is_fnmatch/absolute below */
  411.     char *d;
  412.     /* the number of slashes in d */
  413.     unsigned d_components;
  414.  
  415.     /* If (opts & OPT_UNSET) then no absolute assignment to options has
  416.      * been made.
  417.      * invariant: (opts_add & opts_remove) == 0
  418.      * Which said another way means that the last relative (options + or -)
  419.      * assignment made to each bit is recorded in exactly one of opts_add
  420.      * or opts_remove.
  421.      */
  422.     allow_options_t opts;
  423.     allow_options_t opts_add;
  424.     allow_options_t opts_remove;
  425.     overrides_t override;
  426.     
  427.     /* MIME typing --- the core doesn't do anything at all with this,
  428.      * but it does know what to slap on a request for a document which
  429.      * goes untyped by other mechanisms before it slips out the door...
  430.      */
  431.     
  432.     char *ap_default_type;
  433.   
  434.     /* Authentication stuff.  Groan... */
  435.     
  436.     int satisfy;
  437.     char *ap_auth_type;
  438.     char *ap_auth_name;
  439.     apr_array_header_t *ap_requires;
  440.  
  441.     /* Custom response config. These can contain text or a URL to redirect to.
  442.      * if response_code_strings is NULL then there are none in the config,
  443.      * if it's not null then it's allocated to sizeof(char*)*RESPONSE_CODES.
  444.      * This lets us do quick merges in merge_core_dir_configs().
  445.      */
  446.   
  447.     char **response_code_strings;
  448.  
  449.     /* Hostname resolution etc */
  450. #define HOSTNAME_LOOKUP_OFF    0
  451. #define HOSTNAME_LOOKUP_ON    1
  452. #define HOSTNAME_LOOKUP_DOUBLE    2
  453. #define HOSTNAME_LOOKUP_UNSET    3
  454.     unsigned int hostname_lookups : 4;
  455.  
  456.     signed int do_rfc1413 : 2;   /* See if client is advertising a username? */
  457.  
  458.     signed int content_md5 : 2;  /* calculate Content-MD5? */
  459.  
  460. #define USE_CANONICAL_NAME_OFF   (0)
  461. #define USE_CANONICAL_NAME_ON    (1)
  462. #define USE_CANONICAL_NAME_DNS   (2)
  463. #define USE_CANONICAL_NAME_UNSET (3)
  464.     unsigned use_canonical_name : 2;
  465.  
  466.     /* since is_fnmatch(conf->d) was being called so frequently in
  467.      * directory_walk() and its relatives, this field was created and
  468.      * is set to the result of that call.
  469.      */
  470.     unsigned d_is_fnmatch : 1;
  471.  
  472.     /* should we force a charset on any outgoing parameterless content-type?
  473.      * if so, which charset?
  474.      */
  475. #define ADD_DEFAULT_CHARSET_OFF   (0)
  476. #define ADD_DEFAULT_CHARSET_ON    (1)
  477. #define ADD_DEFAULT_CHARSET_UNSET (2)
  478.     unsigned add_default_charset : 2;
  479.     const char *add_default_charset_name;
  480.  
  481.     /* System Resource Control */
  482. #ifdef RLIMIT_CPU
  483.     struct rlimit *limit_cpu;
  484. #endif
  485. #if defined (RLIMIT_DATA) || defined (RLIMIT_VMEM) || defined(RLIMIT_AS)
  486.     struct rlimit *limit_mem;
  487. #endif
  488. #ifdef RLIMIT_NPROC
  489.     struct rlimit *limit_nproc;
  490. #endif
  491.     apr_off_t limit_req_body;      /* limit on bytes in request msg body */
  492.     long limit_xml_body;           /* limit on bytes in XML request msg body */
  493.  
  494.     /* logging options */
  495.  
  496.     server_signature_e server_signature;
  497.  
  498.     int loglevel;
  499.     
  500.     /* Access control */
  501.     apr_array_header_t *sec_file;
  502.     regex_t *r;
  503.  
  504.     const char *mime_type;       /* forced with ForceType  */
  505.     const char *handler;         /* forced with SetHandler */
  506.     const char *output_filters;  /* forced with SetOutputFilters */
  507.     const char *input_filters;   /* forced with SetInputFilters */
  508.     int accept_path_info;        /* forced with AcceptPathInfo */
  509.  
  510.     apr_hash_t *ct_output_filters; /* added with AddOutputFilterByType */
  511.  
  512.     /*
  513.      * What attributes/data should be included in ETag generation?
  514.      */
  515.     etag_components_t etag_bits;
  516.     etag_components_t etag_add;
  517.     etag_components_t etag_remove;
  518.  
  519.     /*
  520.      * Run-time performance tuning
  521.      */
  522. #define ENABLE_MMAP_OFF    (0)
  523. #define ENABLE_MMAP_ON     (1)
  524. #define ENABLE_MMAP_UNSET  (2)
  525.     int enable_mmap;  /* whether files in this dir can be mmap'ed */
  526.  
  527. } core_dir_config;
  528.  
  529. /* Per-server core configuration */
  530.  
  531. typedef struct {
  532.   
  533. #ifdef GPROF
  534.     char *gprof_dir;
  535. #endif
  536.  
  537.     /* Name translations --- we want the core to be able to do *something*
  538.      * so it's at least a minimally functional web server on its own (and
  539.      * can be tested that way).  But let's keep it to the bare minimum:
  540.      */
  541.     const char *ap_document_root;
  542.   
  543.     /* Access control */
  544.  
  545.     char *access_name;
  546.     apr_array_header_t *sec_dir;
  547.     apr_array_header_t *sec_url;
  548. } core_server_config;
  549.  
  550. /* for AddOutputFiltersByType in core.c */
  551. void ap_add_output_filters_by_type(request_rec *r);
  552.  
  553. /* for http_config.c */
  554. void ap_core_reorder_directories(apr_pool_t *, server_rec *);
  555.  
  556. /* for mod_perl */
  557. AP_CORE_DECLARE(void) ap_add_per_dir_conf(server_rec *s, void *dir_config);
  558. AP_CORE_DECLARE(void) ap_add_per_url_conf(server_rec *s, void *url_config);
  559. AP_CORE_DECLARE(void) ap_add_file_conf(core_dir_config *conf, void *url_config);
  560. AP_CORE_DECLARE_NONSTD(const char *) ap_limit_section(cmd_parms *cmd, void *dummy, const char *arg);
  561.  
  562. #endif
  563.  
  564.  
  565. /* ----------------------------------------------------------------------
  566.  *
  567.  * Runtime status/management
  568.  */
  569.  
  570. typedef enum {
  571.     ap_mgmt_type_string,
  572.     ap_mgmt_type_long,
  573.     ap_mgmt_type_hash
  574. } ap_mgmt_type_e;
  575.  
  576. typedef union {
  577.     const char *s_value;
  578.     long i_value;
  579.     apr_hash_t *h_value;
  580. } ap_mgmt_value;
  581.  
  582. typedef struct {
  583.     const char *description;
  584.     const char *name;
  585.     ap_mgmt_type_e vtype;
  586.     ap_mgmt_value v;
  587. } ap_mgmt_item_t;
  588.  
  589. /* Handles for core filters */
  590. extern AP_DECLARE_DATA ap_filter_rec_t *ap_subreq_core_filter_handle;
  591. extern AP_DECLARE_DATA ap_filter_rec_t *ap_core_output_filter_handle;
  592. extern AP_DECLARE_DATA ap_filter_rec_t *ap_content_length_filter_handle;
  593. extern AP_DECLARE_DATA ap_filter_rec_t *ap_net_time_filter_handle;
  594. extern AP_DECLARE_DATA ap_filter_rec_t *ap_core_input_filter_handle;
  595.  
  596. /**
  597.  * This hook provdes a way for modules to provide metrics/statistics about
  598.  * their operational status.
  599.  *
  600.  * @param p A pool to use to create entries in the hash table
  601.  * @param val The name of the parameter(s) that is wanted. This is
  602.  *            tree-structured would be in the form ('*' is all the tree,
  603.  *            'module.*' all of the module , 'module.foo.*', or
  604.  *            'module.foo.bar' )
  605.  * @param ht The hash table to store the results. Keys are item names, and
  606.  *           the values point to ap_mgmt_item_t structures.
  607.  * @ingroup hooks
  608.  */
  609. AP_DECLARE_HOOK(int, get_mgmt_items,
  610.                 (apr_pool_t *p, const char * val, apr_hash_t *ht))
  611.  
  612. /* ---------------------------------------------------------------------- */
  613.  
  614. #ifdef __cplusplus
  615. }
  616. #endif
  617.  
  618. #endif    /* !APACHE_HTTP_CORE_H */
  619.